<?php
defined('IN_IA') or exit('Access Denied');

class Bus_SudokuModuleSite extends WeModuleSite {
	public function doMobileIndex() {
		global $_GPC,$_W;
		$id = $_GPC["id"];
		$uniacid = $_W['uniacid'];
		$sql = "SELECT * FROM ".tablename('bus_sudoku_activity')." WHERE uniacid = :uniacid and id = :id";
		$params = array(':uniacid'=>$uniacid,':id'=>$id);
		$temp_list = pdo_fetch($sql,$params);
		include $this->template('index');
	}	
	public function createNonceStr($length = 16) {
	    $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	    $str = "";
	    for ($i = 0; $i < $length; $i++) {
	      $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
	    }
	    return $str;
 	}
 	public function getAccessToken(){
		global $_W;
		load()->classs('weixin.account');
		$accObj = WeixinAccount::create($_W['acid']);
		$access_token = $accObj->fetch_token();
		return $access_token;
	}
}